class Twinsunflower extends GuaAnimation {
    static new(game) {
        let p = new this(game, animationTwinsunflower)
        p.setup()
        return p
    }

    setup() {
        // row表示在草地的第几排
        this.row = -1
        this.cooldown = 200
        this.score = 150
    }

    remove() {
        this.scene.removeFlower(this)
    }


    creatSun() {
        this.cooldown--
        if (this.cooldown === 0) {
            // 开始冷却
            this.cooldown = 200
            // 生成阳光
            let s = this.game.scene
            for (let i = 0; i < 2; i++) {
                let pb = Sun.new(this.game)
                pb.row = this.row
                pb.column = this.column
                pb.x = this.x + i * 15
                pb.y = this.y
                pb.k = (pb.x - pb.gx) / pb.speed
                pb.ky = (pb.y - pb.gy) / pb.k

                this.game.scene.addElement(pb)
                s.addElement(pb)
                s.suns.push(pb)
            }
        }
    }

    update() {
        super.update()
        this.creatSun()
    }
}